Newer
Older
Simple-Multiplayer-Unity3D / Multiplayer Project / Library / PackageCache / com.unity.collab-proxy@2.7.1 / Editor / Views / ApplyShelveWithConflictsQuestionerBuilder.cs
  1. using Codice.Client.Commands;
  2. using Codice.Client.Common;
  3. using PlasticGui;
  4. using Unity.PlasticSCM.Editor.UI;
  5. namespace Unity.PlasticSCM.Editor.Views
  6. {
  7. internal class ApplyShelveWithConflictsQuestionerBuilder :
  8. IApplyShelveWithConflictsQuestionerBuilder
  9. {
  10. public IApplyShelveWithConflictsQuestioner Get()
  11. {
  12. return new ApplyShelveWithConflictsQuestioner();
  13. }
  14. }
  15. internal class ApplyShelveWithConflictsQuestioner : IApplyShelveWithConflictsQuestioner
  16. {
  17. ApplyShelveWithConflictsAction IApplyShelveWithConflictsQuestioner.ApplyShelveWithConflicts(
  18. string dstObject, long shelvesetId)
  19. {
  20. ApplyShelveWithConflictsAction result = ApplyShelveWithConflictsAction.Cancel;
  21. GUIActionRunner.RunGUIAction(() =>
  22. {
  23. result = ConfirmContinue(dstObject);
  24. });
  25. return result;
  26. }
  27. static ApplyShelveWithConflictsAction ConfirmContinue(string dstObject)
  28. {
  29. GuiMessage.GuiMessageResponseButton result = GuiMessage.ShowQuestion(
  30. PlasticLocalization.Name.ApplyShelveWithConflictsTitle.GetString(),
  31. PlasticLocalization.Name.ApplyShelveWithConflictsExplanation.GetString(dstObject),
  32. PlasticLocalization.Name.ResolveConflictsNow.GetString(),
  33. PlasticLocalization.Name.ResolveConflictsLater.GetString(),
  34. null);
  35. return result == GuiMessage.GuiMessageResponseButton.Positive
  36. ? ApplyShelveWithConflictsAction.ApplyShelve
  37. : ApplyShelveWithConflictsAction.Cancel;
  38. }
  39. }
  40. }